#导包
import redis

#定义ip和端口
host = "localhost"
port = 6379

#建立链接
r = redis.Redis(host=host,port=port)

#赋值
r.set('test','test')

#取值
code = r.get('test')

#转码
code = code.decode("utf-8")

print(code)

